package com.onlinevideo.service.impl;

import com.onlinevideo.dao.CategoryDao;
import com.onlinevideo.dao.impl.CategoryDaoImpl;
import com.onlinevideo.entity.Category;
import com.onlinevideo.service.CategoryService;

import java.util.List;

public class CategoryServiceImpl implements CategoryService {

    private CategoryDao categoryDao = new CategoryDaoImpl();

    @Override
    public int insert(Category category) {
        return categoryDao.insert(category);
    }

    @Override
    public int delete(Long id) {
        return categoryDao.delete(id);
    }

    @Override
    public int update(Category category) {
        return categoryDao.update(category);
    }

    @Override
    public Category queryById(Long id) {
        return categoryDao.queryById(id);
    }
    @Override
    public Category queryByCategory(String categoryName){
        return categoryDao.queryByCategory(categoryName);
    }

    @Override
    public List<Category> queryAll() {
        return categoryDao.queryAll();
    }
}
